package com.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.provider.dao.TProductPlaneDao;
import com.provider.entity.TPlane;
import com.provider.entity.TProductPlane;
import com.provider.service.TProductPlaneService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 产品计划主表(TProductPlane)表服务实现类
 *
 * @author makejava
 * @since 2024-04-28 16:59:06
 */
@Service("tProductPlaneService")
@Transactional(rollbackFor = Exception.class)
public class TProductPlaneServiceImpl extends ServiceImpl<TProductPlaneDao, TProductPlane> implements TProductPlaneService {

    @Override
    public List<TProductPlane> queryProductPlanBySystemId(String systemId) {
        LambdaQueryWrapper<TProductPlane> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TProductPlane::getSystemId, systemId).eq(TProductPlane::getIsValid,"Y");
        return this.list(lambdaQueryWrapper);
    }

    @Override
    public List<TProductPlane> queryAllProductPlan() {
        LambdaQueryWrapper<TProductPlane> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TProductPlane::getIsValid,"Y");
        return this.list(lambdaQueryWrapper);
    }
}

